home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / librw / RWBufferedPageHeap.z / RWBufferedPageHeap
Encoding:
Text File  |  2002-10-03  |  7.7 KB  |  199 lines

  1.  
  2.  
  3.  
  4. RRRRWWWWBBBBuuuuffffffffeeeerrrreeeeddddPPPPaaaaggggeeeeHHHHeeeeaaaapppp((((3333CCCC++++++++))))                              RRRRWWWWBBBBuuuuffffffffeeeerrrreeeeddddPPPPaaaaggggeeeeHHHHeeeeaaaapppp((((3333CCCC++++++++))))
  5.  
  6.  
  7.  
  8. NNNNaaaammmmeeee
  9.      RWBufferedPageHeap - Rogue Wave library class
  10.  
  11. SSSSyyyynnnnooooppppssssiiiissss
  12.               #include <rw/bufpage.h>
  13.  
  14.  
  15.  
  16.               ((((AAAAbbbbssssttttrrrraaaacccctttt bbbbaaaasssseeee ccccllllaaaassssssss ))))
  17.  
  18.  
  19.  
  20.  
  21. DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
  22.      This is an abstract base class that represents an abstract page heap
  23.      buffered through a set of memory buffers.  It inherits from the abstract
  24.      base class RRRRWWWWVVVViiiirrrrttttuuuuaaaallllPPPPaaaaggggeeeeHHHHeeeeaaaapppp, which represents an abstract page heap.
  25.      RRRRWWWWBBBBuuuuffffffffeeeerrrreeeeddddPPPPaaaaggggeeeeHHHHeeeeaaaapppp will supply and maintain a set of memory buffers.
  26.      Specializing classes should supply the actual physical mechanism to swap
  27.      pages in and out of these buffers by supplying definitions for the pure
  28.      virtual functions sssswwwwaaaappppIIIInnnn((((RRRRWWWWHHHHaaaannnnddddlllleeee,,,, vvvvooooiiiidddd****)))) and sssswwwwaaaappppOOOOuuuutttt((((RRRRWWWWHHHHaaaannnnddddlllleeee,,,, vvvvooooiiiidddd****)))).
  29.      The specializing class should also supply appropriate definitions for the
  30.      public functions aaaallllllllooooccccaaaatttteeee(((()))) and ddddeeeeaaaallllllllooooccccaaaatttteeee((((RRRRWWWWHHHHaaaannnnddddlllleeee)))).  For a sample
  31.      implementation of a specializing class, see class RRRRWWWWDDDDiiiisssskkkkPPPPaaaaggggeeeeHHHHeeeeaaaapppp.
  32.  
  33. PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
  34.      None
  35.  
  36. PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr
  37.               RWBufferedPageHeap(unsigned pgsize, unsigned nbufs=10);
  38.  
  39.  
  40.      Constructs a buffered page heap with page size ppppggggssssiiiizzzzeeee.  The number of
  41.      buffers (each of size ppppggggssssiiiizzzzeeee) that will be allocated on the heap will be
  42.      nnnnbbbbuuuuffffssss.  If there is insufficient memory to satisfy the request, then the
  43.      state of the resultant object as returned by member function iiiissssVVVVaaaalllliiiidddd(((())))
  44.      will be FFFFAAAALLLLSSSSEEEE, otherwise, TTTTRRRRUUUUEEEE.
  45.  
  46. PPPPrrrrooootttteeeecccctttteeeedddd MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
  47.               virtual RWBoolean
  48.           sssswwwwaaaappppIIIInnnn(RWHandle h, void* buf)  = 0;
  49.           virtual RWBoolean
  50.           sssswwwwaaaappppOOOOuuuutttt(RWHandle, h void* buf) = 0;
  51.  
  52.  
  53.      It is the responsibility of the specializing class to supply definitions
  54.      for these two pure virtual functions.  Function sssswwwwaaaappppOOOOuuuutttt(((()))) should copy the
  55.      page with handle hhhh from the buffer pointed to by bbbbuuuuffff to the swapping
  56.      medium.  Function sssswwwwaaaappppIIIInnnn(((()))) should copy the page with handle hhhh into the
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RRRRWWWWBBBBuuuuffffffffeeeerrrreeeeddddPPPPaaaaggggeeeeHHHHeeeeaaaapppp((((3333CCCC++++++++))))                              RRRRWWWWBBBBuuuuffffffffeeeerrrreeeeddddPPPPaaaaggggeeeeHHHHeeeeaaaapppp((((3333CCCC++++++++))))
  71.  
  72.  
  73.  
  74.      buffer pointed to by bbbbuuuuffff.
  75.  
  76. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
  77.               virtual RWHandle
  78.           aaaallllllllooooccccaaaatttteeee() = 0;
  79.  
  80.  
  81.      It is the responsibility of the specializing class to supply a definition
  82.      for this pure virtual function.  The specializing class should allocate a
  83.      page and return a unique handle for it.  It should return zero if it
  84.      cannot satisfy the request.  The size of the page is set by the
  85.      constructor.
  86.  
  87.               virtual
  88.           ~~~~RRRRWWWWBBBBuuuuffffffffeeeerrrreeeeddddPPPPaaaaggggeeeeHHHHeeeeaaaapppp();
  89.  
  90.  
  91.      Deallocates all internal buffers.
  92.  
  93.               RWBoolean
  94.           iiiissssVVVVaaaalllliiiidddd();
  95.  
  96.  
  97.      Returns TTTTRRRRUUUUEEEE if self is in a valid state.  A possible reason why the
  98.      object might not be valid is insufficient memory to allocate the internal
  99.      buffers.
  100.  
  101.               virtual void
  102.           ddddeeeeaaaallllllllooooccccaaaatttteeee(RWHandle h);
  103.  
  104.  
  105.      Redefined from class RRRRWWWWVVVViiiirrrrttttuuuuaaaallllPPPPaaaaggggeeeeHHHHeeeeaaaapppp.  It is never an error to call
  106.      this function with argument zero.  Even though this is not a pure virtual
  107.      function, it is the responsibility of the specializing class to supply an
  108.      appropriate definition for this function.  All this definition does is
  109.      release any buffers associated with the handle hhhh.  Just as the actual
  110.      page allocation is done by the specializing class through virtual
  111.      function aaaallllllllooooccccaaaatttteeee(((()))), so must the actual deallocation be done by
  112.      overriding ddddeeeeaaaallllllllooooccccaaaatttteeee(((()))).
  113.  
  114.               virtual void
  115.           ddddiiiirrrrttttyyyy(RWHandle h);
  116.  
  117.  
  118.      Redefined from class RRRRWWWWVVVViiiirrrrttttuuuuaaaallllPPPPaaaaggggeeeeHHHHeeeeaaaapppp.
  119.  
  120.               virtual void*
  121.           lllloooocccckkkk(RWHandle h);
  122.  
  123.  
  124.      Redefined from class RRRRWWWWVVVViiiirrrrttttuuuuaaaallllPPPPaaaaggggeeeeHHHHeeeeaaaapppp.
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RRRRWWWWBBBBuuuuffffffffeeeerrrreeeeddddPPPPaaaaggggeeeeHHHHeeeeaaaapppp((((3333CCCC++++++++))))                              RRRRWWWWBBBBuuuuffffffffeeeerrrreeeeddddPPPPaaaaggggeeeeHHHHeeeeaaaapppp((((3333CCCC++++++++))))
  137.  
  138.  
  139.  
  140.               virtual void
  141.           uuuunnnnlllloooocccckkkk(RWHandle h);
  142.  
  143.  
  144.      Redefined from class RRRRWWWWVVVViiiirrrrttttuuuuaaaallllPPPPaaaaggggeeeeHHHHeeeeaaaapppp.
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.